package com.chapter09;

import org.apache.commons.dbutils.ResultSetHandler;

import java.sql.ResultSet;
import java.sql.SQLException;

public class CustomStringHandler implements ResultSetHandler<String> {

    // 最后的转换方法
    @Override
    public String handle(ResultSet rs) throws SQLException {
        String result = "";
        if (rs.next()) {
            Object v1 = rs.getObject(1);
            Object v2 = rs.getObject(2);
            result = v1.toString() + "===" + v2.toString();
        }

        return result;
    }
}
